package define

import (
	"github.com/dgrijalva/jwt-go"
	"time"
)

var (
	// Jwtkey 秘钥
	Jwtkey = "sys-admin"
	// token 有效期: 7天
	TokenExpire = time.Now().Add(time.Second * 3600 * 24 * 7).Unix()
	// 刷新token有效期14天
	RefreshTokenExpire = time.Now().Add(time.Second * 3600 * 24 * 14).Unix()
	// 默认分页显示条数
	DefaultSize = 10
	// 静态文件目录
	StaticResource = "/Users/sgzeng/GolandProjects/go-admin/go-admin-static"

	// 邮件信息
	// 邮件发送方
	EmailFrom     = "1254520806@qq.com"
	EmailPassword = "qcybywogyzmggide"
	// 邮箱Host
	EmailHost = "smtp.qq.com"
	// 邮箱端口号
	EmailPort = "587"

	// ip2region 存放路径
	DbPath = StaticResource + "/ip2region_v4.xdb"
)

type UserClaims struct {
	Id   uint
	Name string
	// 是否超管
	IsAdmin bool
	RoleId  uint
	jwt.StandardClaims
}
